/*
 * Group 3, User Interface Programming II (vt11)
 * Pooya | Flora | Monica | Can
 */
package vical.controller;

import javax.swing.ImageIcon;
import java.net.URL;

/**
 * The class to load Icons or Images
 * 
 * @author Can
 */
public class IconManager {

    public enum Icons {

        Birthday,
        Anniversary,
        Tour,
        Wedding,
        Hiking
    }
    private final static String iconPath = "vical/resources/icon/";

    public static ImageIcon getImageIcon(String iconName) {
        URL iconURL = ClassLoader.getSystemClassLoader().getResource(iconPath + iconName);
        if (iconURL != null) {
            return new ImageIcon(iconURL);
        } else {
            return null;
        }

    }

    /**
     * Load the icon for a specific predefined type
     * @param icon
     * @return
     */
    public static ImageIcon getImageIcon(Icons icon) {
        ImageIcon result = null;
        switch (icon) {
            case Anniversary:
                result = getImageIcon("anniversary_icon.gif");
                break;
            case Birthday:
                result = getImageIcon("cake.png");
                break;
            case Hiking:
                result = getImageIcon("hiking.gif");
                break;
            case Tour:
                result = getImageIcon("Compass.jpg");
                break;
            case Wedding:
                result = getImageIcon("hearts.png");
                break;
        }
        return result;
    }
}
